<template>
  <el-drawer
    v-model="visible"
    :title="title"
    size="100%"
    :before-close="handleClose"
    destroy-on-close
  >
    <BpmProcessInstanceDetail
      v-if="visible"
      :id="String(processInstanceId)"
      @success="handleSuccess"
    />
  </el-drawer>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import BpmProcessInstanceDetail from '@/views/bpm/processInstance/detail/index.vue'

const message = useMessage() // 消息弹窗

const props = defineProps<{
  modelValue: boolean
  processInstanceId: string | number
  title?: string
}>()
const emit = defineEmits(['update:modelValue', 'success'])

const visible = computed({
  get: () => props.modelValue,
  set: v => emit('update:modelValue', v)
})

const handleClose = () => {
  visible.value = false
}
const handleSuccess = () => {
  emit('success')
  visible.value = false

}
</script> 